package com.hmdp.utils;

/**
 * @Author Eason
 * @Date 2024/11/16 14:32
 * @PackageName:com.hmdp.utils
 * @ClassName: ILock
 * @Description: TODO
 */
public interface ILock {

    /**
    * @Description : 尝试获取锁
    * @Date 14:36 2024/11/16
    * @Param [timeoutSec] 锁持有的超时时间，过期自动释放
    * @return boolean true 获取锁成功，false 获取锁失败
    */
    boolean tryLock(long timeoutSec);


    /*
    * 释放锁
    * */
    void unlock();
}
